package engine;

import java.util.ArrayList;

public class EventObserver<E> implements EventObserver_IF<E> {
	
	private ArrayList<E> events;

	public EventObserver() {
		emptyEvents();
	}
	
	@Override
	public void addEvent(E event) {
		events.add(event);
	}

	@Override
	public ArrayList<E> getEvents() {
		ArrayList<E> out = events;
		emptyEvents();
		return out;
	}

	@Override
	public void emptyEvents() {
		events = new ArrayList<E>();
	}

}